package com.zz.ecommerce.searchManage.customsDeclaration;

import com.zz.ecommerce.common.GridRequest;
import com.zz.ecommerce.common.GridResult;
import com.zz.ecommerce.common.bean.qdc.db.TDeclformHeadQdc;
import com.zz.ecommerce.common.constants.TableConstants;
import com.zz.ecommerce.declareManage.common.dao.TDeclformHeadQdcDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 查询跟踪服务--报关单查询
 * <p/>
 * Created by fanshilei on 2016/3/28.
 */
@Controller
@RequestMapping("/searchManage/customsDeclaration")
@Scope("prototype")
public class CustomsDeclarationController {

    @Autowired
    private TDeclformHeadQdcDao tDeclformHeadQdcDao;

    /**
     * 申报清单管理
     *
     * @return
     */
    @RequestMapping(value = "init", method = {RequestMethod.GET})
    public String declarationForm() {
        return "searchManage/customsDeclaration/index";
    }

    /**
     * 查询申报清单管理列表
     *
     * @param tDeclformHeadQdc
     * @param request
     * @return
     */
    @RequestMapping("/queryDeclareList")
    @ResponseBody
    public GridResult queryDeclareList(TDeclformHeadQdc tDeclformHeadQdc, GridRequest request) {
        return new GridResult(tDeclformHeadQdcDao.page(TableConstants.T_DECLFORM_HEAD_QDC, tDeclformHeadQdc, request.getStart(), request.getEnd(), request.getSortOrder()), request, tDeclformHeadQdcDao.count(TableConstants.T_DECLFORM_HEAD_QDC, tDeclformHeadQdc));
    }

}
